package com.wangdao.wechatmall.controller.wx;

import com.wangdao.wechatmall.bean.bo.wx.WXFeedbackBO;
import com.wangdao.wechatmall.bean.vo.admin.BaseRespVo;
import com.wangdao.wechatmall.service.wx.WXFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * WXFeedbackController
 * created by feng on 7/11/21
 */

@RestController
@RequestMapping("wx/feedback")
public class WXFeedbackController {

    @Autowired
    WXFeedbackService wxFeedbackService;

    @PostMapping("submit")
    public BaseRespVo submit(@RequestBody WXFeedbackBO wxFeedbackBO) {
        Integer affectedRow = wxFeedbackService.submit(wxFeedbackBO);
        if (affectedRow == 1) {
            return BaseRespVo.ok();
        }
        return BaseRespVo.fail();
    }
}